package com.xsz.controller;

import com.xsz.service.DictTypeService;
import com.xsz.util.ResultVOUtil;
import com.xsz.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("dict")
@Api(value = "字典控制类")
@Slf4j
public class DictController {
    @Resource
    DictTypeService dictTypeService;

    @ApiOperation(value = "根据字典ID查询字典数据")
    @GetMapping("/get")
    public ResultVO selectByNamePwd(@RequestParam("id") String id) {
       log.info(id);
        return ResultVOUtil.success( dictTypeService.getById(id));
    }
}
